<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function formatTime(totalSeconds) {
        let h = parseInt(totalSeconds / 3600 % 24)
        let m = parseInt(totalSeconds / 60 % 60)
        let s = parseInt(totalSeconds % 60)
        let padZero = num => num.toString().padStart(2, '0')
        return `${padZero(h)}:${padZero(m)}:${padZero(s)}`
        }
        let userInput = prompt("请输入总秒数（默认3600秒）：") || "3600"
        let totalSeconds = parseInt(userInput)
        if (isNaN(totalSeconds) || totalSeconds < 0) {
        alert("请输入有效的非负整数秒数！")
        } else {
        let result = formatTime(totalSeconds)
        alert(`转换结果：${result}`)
        }
        </script>
</body>
</html>